package com.cy.controller;

import com.cy.api.ConsumerHttpApi;
import com.cy.service.ConsumerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName FeignConsumerController
 * @Description:类描述
 * @Author Tedu
 * @Date 2021/6/1 11:33
 * @Version V1.0
 **/
@RestController
@RequestMapping("/consumer/feign/")
public class FeignConsumerController {
    //链路模式限流测试
    @Autowired
    private ConsumerService consumerService;

    @Value("${spring.application.name}")
    private String appName;
    @Autowired
    private ConsumerHttpApi consumerHttpApi;

    @GetMapping
    public String doFeignEcho(){
        //链路模式限流测试
        consumerService.doGetResource();

        return consumerHttpApi.echoMessage(appName);
    }
}
